﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CoolCode.Web; 

namespace CoolCode.Services
{
    public class CustomServiceProvider : IServiceProvider
    { 
        #region IServiceProvider Members

        public string Name
        {
            get
            {
                return "CustomServiceProvider";
            } 
        }

        public T ProvideService<T>() where T : class
        {
            if (typeof(T).FullName == typeof(IInspectionService).FullName)
            {
                ICriterionService criterionService = new CriterionService(Config.AppData, new WebCacheStrategy());
                return new InspectionService(criterionService) as T;
            }
            return null;
        }

        #endregion
    }
}
